import CommonState from './commonState';
import LoginState from './loginState';
import UserState from './userState';
import ChatState from './chatState';
import TaskState from './taskState';
import ContactsState from './contactsState';
import ProjectState from './projectState';

class Store {
	// 收集所有的子store, 解决子store之间相互依赖的问题
	// 在子store的constructor函数里面获取其它子store
	// 注意：各个子store的声明顺序问题，在子store的constructor函数里面最好使用setTimeout函数
	constructor() {
		this.commonState = new CommonState(this);
		this.loginState = new LoginState(this);
		this.userState = new UserState(this);
		this.chatState = new ChatState(this);
		this.taskState = new TaskState(this);
		this.contactsState = new ContactsState(this);
		this.projectState = new ProjectState(this);
	}
}

export default new Store()
